/*
 * MenuUtama.java
 *
 * Created on November 10, 2011, 11:39 PM
 */
package Transaksi;

import Login.Login;
import java.awt.GridLayout;

/**
 *
 * @author  Jo
 */
public class MenuUtama extends javax.swing.JFrame {

    /** Creates new form MenuUtama */
    public MenuUtama() {
        initComponents();
        setResizable(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane1 = new javax.swing.JDesktopPane();
        utamaMenuBar = new javax.swing.JMenuBar();
        transaksiMenu = new javax.swing.JMenu();
        transaksiJualMenuItem = new javax.swing.JMenuItem();
        transaksiBeliMenuItem = new javax.swing.JMenuItem();
        laporanMenu = new javax.swing.JMenu();
        jualLaporanItem = new javax.swing.JMenuItem();
        beliLaporanItem = new javax.swing.JMenuItem();
        dataMenu = new javax.swing.JMenu();
        pemasokItem = new javax.swing.JMenuItem();
        barangItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jDesktopPane1.setBackground(new java.awt.Color(236, 233, 216));

        transaksiMenu.setText("Transaksi");

        transaksiJualMenuItem.setText("Transaksi Penjualan");
        transaksiJualMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                transaksiJualMenuItemActionPerformed(evt);
            }
        });
        transaksiMenu.add(transaksiJualMenuItem);

        transaksiBeliMenuItem.setText("Transaksi Pembelian");
        transaksiBeliMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                transaksiBeliMenuItemActionPerformed(evt);
            }
        });
        transaksiMenu.add(transaksiBeliMenuItem);

        utamaMenuBar.add(transaksiMenu);

        laporanMenu.setText("Laporan");

        jualLaporanItem.setText("Laporan Penjualan");
        jualLaporanItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jualLaporanItemActionPerformed(evt);
            }
        });
        laporanMenu.add(jualLaporanItem);

        beliLaporanItem.setText("Laporan Pembelian");
        beliLaporanItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                beliLaporanItemActionPerformed(evt);
            }
        });
        laporanMenu.add(beliLaporanItem);

        utamaMenuBar.add(laporanMenu);

        dataMenu.setText("Data");

        pemasokItem.setText("Data Pemasok");
        pemasokItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pemasokItemActionPerformed(evt);
            }
        });
        dataMenu.add(pemasokItem);

        barangItem.setText("Data Barang");
        barangItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                barangItemActionPerformed(evt);
            }
        });
        dataMenu.add(barangItem);

        utamaMenuBar.add(dataMenu);

        setJMenuBar(utamaMenuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 392, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-408)/2, (screenSize.height-329)/2, 408, 329);
    }// </editor-fold>//GEN-END:initComponents

    private void transaksiJualMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_transaksiJualMenuItemActionPerformed
        // TODO add your handling code here:

        Login login = new Login();
        this.jDesktopPane1.removeAll();
        this.jDesktopPane1.setLayout(new GridLayout(1, 1));
        TransaksiPenjualanForm tranJual = new TransaksiPenjualanForm(login);
        this.setSize(690, 570);
        this.jDesktopPane1.add(tranJual);
        this.setLocation(90, 90);
        this.setResizable(false);
    }//GEN-LAST:event_transaksiJualMenuItemActionPerformed

    private void transaksiBeliMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_transaksiBeliMenuItemActionPerformed
        // TODO add your handling code here:
        Login login = new Login();
        this.jDesktopPane1.removeAll();
        this.jDesktopPane1.setLayout(new GridLayout(1, 1));
        TransaksiPembelianForm tranBeli = new TransaksiPembelianForm(login);
        this.setSize(710, 605);
        this.jDesktopPane1.add(tranBeli);
        this.setLocation(90, 90);
        this.setResizable(false);

    }//GEN-LAST:event_transaksiBeliMenuItemActionPerformed

    private void jualLaporanItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jualLaporanItemActionPerformed
        // TODO add your handling code here:
        this.jDesktopPane1.removeAll();
        this.jDesktopPane1.setLayout(new GridLayout(1, 1));
        LaporanPenjualanHarianForm lapJual = new LaporanPenjualanHarianForm();

        this.setSize(500, 300);
        this.jDesktopPane1.add(lapJual);
        this.setLocation(90, 90);
        this.setResizable(false);
    }//GEN-LAST:event_jualLaporanItemActionPerformed

    private void beliLaporanItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_beliLaporanItemActionPerformed
        // TODO add your handling code here:
        LaporanPembelianHarianForm lapPembelian = new LaporanPembelianHarianForm();
        this.jDesktopPane1.removeAll();
        this.jDesktopPane1.setLayout(new GridLayout(1, 1));

        this.setSize(500, 310);
        this.jDesktopPane1.add(lapPembelian);
        this.setLocation(90, 90);
        this.setResizable(false);
    }//GEN-LAST:event_beliLaporanItemActionPerformed

    private void pemasokItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pemasokItemActionPerformed
        // TODO add your handling code here:
        DataPemasokForm dtPemasok = new DataPemasokForm();
        this.jDesktopPane1.removeAll();
        this.jDesktopPane1.setLayout(new GridLayout(1, 1));

        this.setSize(500, 400);
        this.jDesktopPane1.add(dtPemasok);
        this.setLocation(90, 90);
        this.setResizable(false);
    }//GEN-LAST:event_pemasokItemActionPerformed

    private void barangItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_barangItemActionPerformed
        // TODO add your handling code here:
        DataBarangForm dtBarang = new DataBarangForm();
        this.jDesktopPane1.removeAll();
        this.jDesktopPane1.setLayout(new GridLayout(1, 1));

        this.setSize(550, 400);
        this.jDesktopPane1.add(dtBarang);
        this.setLocation(90, 90);
        this.setResizable(false);
    }//GEN-LAST:event_barangItemActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new MenuUtama().setVisible(true);
                MenuUtama mUtama = new MenuUtama();
                mUtama.setSize(600, 600);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem barangItem;
    private javax.swing.JMenuItem beliLaporanItem;
    private javax.swing.JMenu dataMenu;
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JMenuItem jualLaporanItem;
    private javax.swing.JMenu laporanMenu;
    private javax.swing.JMenuItem pemasokItem;
    private javax.swing.JMenuItem transaksiBeliMenuItem;
    private javax.swing.JMenuItem transaksiJualMenuItem;
    private javax.swing.JMenu transaksiMenu;
    private javax.swing.JMenuBar utamaMenuBar;
    // End of variables declaration//GEN-END:variables
}
